<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWebsiteLetterTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('website_letter', function (Blueprint $table) {
            $table->id();
            $table->string('title')->default('')->comment('标题');
            $table->tinyInteger('range_type')->default(1)->comment('受众范围; 1:所有人 2:指定成员');
            $table->text('content')->nullable()->comment('正文');
            $table->char('link')->default('')->comment('链接');
            $table->unsignedInteger('number_read')->default(0)->comment('已读数量');

            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('website_letter');
    }
}
